<!-- 主界面 -->
<div class="main">
	<!-- 图片容器 -->
	<div class="image-box">
		#for (x : templates)
			<div class="image-item">
				<img src="#(x.screenshot)">
				<div class="image-footer">
				    <span class="template-title">#(x.title)</span>
					<button confirm="确定启用？"  #if(eq(x.id,currentId)) disabled #end url="/admin/template/enableTemplate?id=#(x.id)" class="btn btn-success btn-sm" callback="refreshState">#if(eq(x.id,currentId)) 已启用 #else 启用 #end </button>
					<button confirm="确定禁用？"  #if(notEq(x.id,currentId)) disabled #end url="/admin/template/disableTemplate" class="btn btn-danger btn-sm" callback="refreshState">禁用</button>
				</div>
				
			</div>
		#end
	</div>
	
</div>

<style>
	.main {
		padding-left: 45px;
		padding-right: 45px;
	}
	.image-item img {
    width: 300px;
    min-height:200px;
    max-height: 450px;
   }
  .image-footer {
    visibility: visible;
   }
   .template-title{
    padding:5px 0;
    font-size:14px;
    margin-right:25px;
   }
	
</style>

<script>
    function refreshState(){
      window.location.reload(); 
    }	
	$(function() {
		console.log("进入模板管理页面了.....");
	});
	
	
	/**
	 * 点击图片显示大图
	 */
	layer.photos({
		photos: '.image-box',
		shade: 0.5,
		// closeBtn: 2,
		offset: '50px',
		anim: 5
	});
	
</script>

